package com.juku2024.juku.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.juku2024.juku.R
import com.juku2024.juku.db.entity.NoteModel
import java.text.SimpleDateFormat
import java.util.*
import kotlin.collections.ArrayList

class NoteAdapter(data: ArrayList<NoteModel>): BaseQuickAdapter<NoteModel, BaseViewHolder> (R.layout.item_note, data){


    override fun convert(holder: BaseViewHolder, item: NoteModel) {
        holder.setText(R.id.tvTitle, item.title)
            .setText(R.id.tvDate, SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()).format(item.date))
    }
}